package com.web;

import com.pojo.HuiFu_db;
import com.service.HuiFuService_db;
import com.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/huifu")
public class HuiFuController_db {
    @Autowired
    private HuiFuService_db huiFuServiceDb;

    @RequestMapping("/show")
    public ResultEntity list(String stime,String etime,Integer id){
        return ResultEntity.ok(huiFuServiceDb.list(stime, etime, id));
    }

    @RequestMapping("/all")
    public ResultEntity listAll(){
        return ResultEntity.ok(huiFuServiceDb.listAll());
    }

    @RequestMapping("/listid")
    public ResultEntity listById(Integer jId){
        return ResultEntity.ok(huiFuServiceDb.listById(jId));
    }

    @RequestMapping("/add")
    public ResultEntity add(HuiFu_db huiFuDb){
        return ResultEntity.ok(huiFuServiceDb.add(huiFuDb));
    }

    @RequestMapping("/update")
    public ResultEntity update(HuiFu_db huiFuDb){
        return ResultEntity.ok(huiFuServiceDb.update(huiFuDb));
    }

    @RequestMapping("/delete")
    public ResultEntity del(Integer hId){
        return ResultEntity.ok(huiFuServiceDb.del(hId));
    }
}
